#pragma once
#include<memory>
#include<mutex>
#include<queue>

class Element {

public:
	std::mutex mx;
	void lock();
	void free();
};

template<class T, class Container = std::vector<Element>>
class CycleQueue:public IQueue<std::shared_ptr<T>> {
private:
	const int size_;
	int curIndex;
	int curSize_;
	Container queue_;

public:
	CycleQueue(int size);
	~CycleQueue() = default;

	bool empty() const override;
	bool full() const override;
	int size() const override;
	bool push(T && element) override;
	bool pop() override;
	bool pop(T & element) override;
	T& front() const override;
	T& back() const override;
};
